#pragma once

#include <iostream>
#include <string>
#include "list.hpp"

template <typename T>
class MyStack : public MyList<T>
{
public:
  void push(const T& e) { this->insertAsLast(e); };
  T pop() { return this->remove( this->size() - 1); };
  T& top() { return (*this)[this->size() - 1]; };
};

template <typename T>
class MyQueue : public MyList<T>
{
public:
  void enqueue(T const& e) { this->insertAsLast(e); };
  T deqeue() { return this->remove(this->first()); };
  T& front() { return this->first()->data; };
};